package com.example.month11.indicator;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;


import com.example.recyclerview01.R;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

public class ItemFragment extends Fragment {

    private String name;
    private ItemFragment(String item) {
        this.name = item;
    }

    public static ItemFragment newInstance(String item) {
        ItemFragment fragment = new ItemFragment(item);
        return fragment;
    }

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.item_fragment, container, false);
        TextView textView = view.findViewById(R.id.id_name);
        textView.setText(name);
        return view;
    }
}
